module.exports = function ($scope, toaster, $modalInstance, createSaleDmw, getSaleList) {
  $scope.obj = {};

	$scope.cancel = function () {
		$modalInstance.dismiss('cancel');
	};

	getSaleList.save({}, function(res){
		if (res.errcode === 0) {
			$scope.sale_list = res.data;
		} else {
			alert(res.errmsg);
		}
	});

	$scope.ok = function(){
    createSaleDmw.save($scope.obj, function (res) {
      if (res.errcode === 0) {
        toaster.success({ title: '', body: '添加成功！' })
        $modalInstance.close();
      } else {
        toaster.error({ title: '', body: '添加失败！' })
      }
    });
	};
};